package edu.guet.server.service.imple;

import edu.guet.server.mapper.ShowUnitMapper;
import edu.guet.server.model.vo.SubUnitVO;
import edu.guet.server.model.vo.SubunitResourceVO;
import edu.guet.server.model.vo.UnitVO;
import edu.guet.server.service.ShowUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShowUnitServiceImpl implements ShowUnitService {

    @Autowired
    private ShowUnitMapper unitMapper;

    @Override
    public List<UnitVO> showUnits(Long semesterId) {

        return unitMapper.findUnitWithSemesterId(semesterId);
    }

    @Override
    public SubUnitVO showSubUnitsandResource(Integer unitId) {

        return unitMapper.showSubUnitsAndResource(unitId);
    }
}
